//
//  ClientDBO.h
//  POS
//
//  Created by sigma xu on 5/6/13.
//  Copyright (c) 2013 sigma xu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "AppDelegate.h"

@interface ClientDBO : NSObject{
    NSString *id_client;
    NSString *client_code;
    NSString *client_name;
    NSString *contact;
    NSString *tel;
    NSString *fax;
    NSString *address;
    NSString *status;
    
    sqlite3 *posDB;
    NSString *databasePath;
    sqlite3_stmt * selectstmt;
    sqlite3_stmt * updatestmt;
    sqlite3_stmt * checkstmt;
    sqlite3_stmt * insertstmt;
    
    NSMutableArray *client_list;
    
}
@property (nonatomic, readwrite) NSString *id_client;
@property (nonatomic, readwrite) NSString *client_code;
@property (nonatomic, readwrite) NSString *client_name;
@property (nonatomic, readwrite) NSString *contact;
@property (nonatomic, readwrite) NSString *tel;
@property (nonatomic, readwrite) NSString *fax;
@property (nonatomic, readwrite) NSString *address;
@property (nonatomic, readwrite) NSString *status;

-(NSMutableArray *) load_clients_list;
-(NSMutableArray *) load_favorites_list;
-(void) add_client_to_favorite:(NSString *)client_id;
-(void) remove_favorite:(NSString *)client_id;
-(ClientDBO *) get_client_by_id:(NSString *)client_id;
-(void)insert_client;
-(void)clear_client;

@end
